package HTMLParser.HTMLTag;

import Parser.Token;

/*******************************************************************************
 * This class deals with List tags. Its main function is represent <OL> or <UL>
 * tags, representing Ordered and Unordered lists respectively.
 * @author James Johnstone
 * @version FINAL
 *******************************************************************************/
public class List extends Tag {

    private boolean ordered;

    /*******************************************************************************
     * Constructor for the List class. Takes one variable which is a Token
     * representing the List Tag (example: <OL> or <UL>). It then finds out if the
     * Tag is for an ordered list or an unordered list, and sets a boolean ordered
     * to represent this.
     *******************************************************************************/
    public List(Token t) {
        super(t, t.getToken().toLowerCase());
        ordered = t.getToken().toLowerCase().equals("ol");
    }

    /***************************************************************************
     * This method will return a boolean representing the type of list.
     * @return A boolean, true if the list is ordered, otherwise false.
     ***************************************************************************/
    public boolean isOrdered() {
        return ordered;
    }
}
